//猎人
module.exports = function(room,chair) {
	var basic = require("./roleBasic.js")
	basic.call(this,chair)
	console.log(basic)
	this.name = "猎人"			//角色名
	this.role = "hunter"		//角色类型
	this.camp = "protoss"   	//阵营	werewolf  protoss  villager
	this.survive = true 	  	//存活状态
	this.votePower = true   	//投票权
	this.showRole = "normal"	//显示状态
	//角色行动
	this.action = function(type,target,cb) {
		if(room.state != room.DAY_HUNTER_READY){
			cb(false,"不在猎人开枪阶段")
			return
		}
		if(this.role !== "hunter"){
			cb(false,"身份错误：hunter : "+this.role)
			return
		}
		if(typeof(target) != "number" || !room.roleList[target].survive){
			cb(false,"目标错误 : "+target)
			return
		}
		this.showRole = "die-hunter"
		if(target != -1){
			var notify = {
				cmd : "hunterGun",
				chair : this.chair,
				target : target,
				showRole : this.showRole,
			}
			room.sendAll(notify)
			room.dieDispose(target,"gun")
		}
		cb(true)
	}
	//获取自身信息
	this.getRoleInfo = function() {
		var info = {
			name : this.name,
			role : this.role,
			camp : this.camp,
			survive : this.survive,
			votePower : this.votePower,
			showRole : this.showRole,
		}
		return info
	}
}